Simple SNMP library
This is the first release of the Simple SNMP library for Java. It
is composed of three components: a MIB compiler, the SNMP library
itself, and a simple GUI application. This SNMP library only
supports version 1 of the SNMP standard as defined in RFC's 1155,
1157, 1212 and 1213.
This package is written to use features of Java 1.1. You should
get and install this version of Java for your platform, if you
haven't done so already.
Also to run the MIB compiler you need to get Java-Lex and Java Cup
run-times and install them. These packages are found in the
following locations:
Installation
Extract the files from the package. You can run the java programs
in the directory it creates or move the class files, which are
under the directory aka
, to your collection of class files.
SNMP Library
This library at the moment supports the following SNMP operations:
- Get - get a SNMP object value.
- Get Next - get the next SNMP object value.
- Set - set a SNMP object value.
Snmp Traps are not supported at the moment, but they will most
likely be in a future release.
There is javadoc
documentation
on the SNMP library in the doc directory. The Snmp class is the Main entry
point to the library.
Running the command line demostration
To run the command line demostration:
java aka.snmp.Snmp
cmd hostname community-name
snmp-variable [set-value]
where:
- cmd is one of
get, getnext, set
and
walk
.
walk
does a getnext walk of the mib on the agent
starting at a particular position on the MIB.
- hostname is the hostname or IP number of the
host where the SNMP agent is running.
- community-name is the SNMP community name of the
SNMP agent. You need to know this to get SNMP value from the
SNMP agent.
- snmp-variable this is the SNMP variable to
perform the command with.
- set-value This is the value to set.
MIB Compiler
The MIB compiler compiles ASN.1 SNMP definitions in a file which
is loaded by the SNMP library at run time. The library comes with
a file mib-V1.txt
which is the MIB definitions from
RFC 1213.
The compiler compiles this file and generates a ser
Java serialization file for the SNMP library to read in.
Running the compiler
To run the compiler on a UNIX platform:
java aka.mc.Main < mib-V1.txt
This will produce a mibs.ser
file.
GUI Application
The GUI application demonstrates the SNMP library by polling a SNMP
agent at regular intervals and displaying values.
Running the application
java aka.gui.SnmpTable
The application starts up polling for two SNMP values
sysName
and sysUpTime
, on the
localhost
. You change the host by replacing
localhost
in the host
text field.
You can change the add a new variable or delete a variable using
the menu items under the Edit
menu. To delete a
variable, select it from the list and then choose the Delete
Variable
menu item from the Edit
menu. Also you can
change the polling interval and SNMP community name from this menu
item as well.
Future Directions
Some more things that I'm thinking of implementing in this
library:
- SNMP Trap collector. Collects SNMP trap events.
- Better MIB compiler. The current one cheats a bit.
- SNMP V2 client implementation. Implements the second
version of the SNMP standard.
- SNMP Agent implementation, modularized to load at run-time
classes implementing SNMP objects.
- SNMP GUI tree walker. Displays the SNMP MIB tree and
values.
- SNMP flavored Java Beans.
Thanks To
The Simple SNMP library uses the following Java tools
- Java-Lex, A lexical analyser generator, Version 1.1, by
Elliot Joel Berk, Department of Computer Science, Princeton
University.
- Java Cup, LALR Parser Generator for Java, Version 0.9 by
Scott E Hudson, Graphics Visualization and Usability Center
Georgia Institute of Technology.
Copyright
Snmp Library
Copyright (C) 1997 Alex Kowalenko Associates Pty Ltd.
All rights reserved.This software maybe be free distributed,
any any form, without fee,
but may not be modified in any way without express permission of
the directors of Alex Kowalenko Associates Pty Ltd.
Alex Kowalenko Associates Pty Ltd makes no representations or
warranties about the suitability of the software, not even the
implied warranty of merchantability or fitness for any particular
purpose.
Alex Kowalenko
Last modified: Mon Jun 9 20:45:05 EST 1997